package com.propose.controller;

import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.board.util.StringUtil;
import com.propose.dao.ProposeDao;
import com.propose.domain.ProposeCommand;

@Controller
public class ProposeDetailController {

	private Logger log = Logger.getLogger(this.getClass());
	
	@Autowired
	private ProposeDao proposeDao;
			
	@RequestMapping("/propose/detail.do")
	public ModelAndView process(@RequestParam("id") String id, HttpSession session){

		if(log.isDebugEnabled()){
			log.debug("id : "+id);
		}
		
		ProposeCommand proposeCommand = proposeDao.selectPropose(id);
		
		session.setAttribute("otherperson", proposeCommand.getId());
		
		return new ModelAndView("proposeDetail","proposeCommand",proposeCommand);
	}
}

